{echo:JS::import("form")}
{echo:JS::import('dialog?skin=tinysimple');}
{echo:JS::import('dialogtools');}
<link type="text/css" rel="stylesheet" href="{url:#css/ucenter.css}" />
<div class="container clearfix">
	{widget:name=sub_navs action=ucsidebar sidebar=$sidebar act=$actionId}
	<div class="content clearfix uc-content">
		{set:$uid=$user[id]}
		<h1 class="title"><span>资助还款：</span></h1>
		<div class="mt10">
	<table class="simple">
		<tr><td>当前账户余额</td><td>借款累计</td><td>还款累计</td><td>利息累计</td><td>待还累计</td></tr>
		<tr class="red">
		<td>{$customer['balance']|'0'}</td>
		<td>{$currency_symbol}{echo:Zyk_tj::sum('pd','sq_money',"sq_id=$uid and is_ok>1")|0}</td>
		<td>{$currency_symbol}{echo:Zyk_tj::sum('pd','h_money',"sq_id=$uid and is_ok=3")|0}</td>
		<td>{$currency_symbol}{echo:Zyk_tj::sum('pd','lx_money',"sq_id=$uid and is_ok=3")|0}</td>
		<td>{$currency_symbol}{echo:Zyk_tj::sum('pd','sq_money',"sq_id=$uid and is_ok=2")+Zyk_tj::sum('pd','lx_money',"sq_id=$uid and is_ok=2")}</td>
		</tr>
	</table>
	<form id="sq_form" action="{url:/ucenter/hk_save}" method="post" target="_blank" callback="submit_sq">
		<table class="form">
			<tr><input type="hidden" name="pid" id="pid" value="{$p[pd_id]}">
				<td >资助人账号：</td>
				<td class="">{echo:Common::getUid($p[fc_id])[name]}</td>
			</tr>
			<tr>
				<td >还款金额：</td>
				<td class="red">{$p[h_money]}</td>  
			</tr>
			<tr>
				<td class="f12">二级密码：</td>
				<td><input type="password" name="pass2" id="pass2" pattern="required" style="width: 150px;" alt="输入二级密码"> <label></label></td>
			</tr>
			<tr>
				<td colspan="2" class="tc"><input type="submit" class="btn btn-main" value="提交"></td>
			</tr>
			<tr>
				<td colspan="2" class="f12 text-warning">* 申请成功后系统会在资助频道展示您的资助信息，请等待资助人的资助！<br>* 所有获得资助的款项只能在平台内使用！<br>* 从获得资助起须{echo:Common::getConfigJjsetValue('dk_qx')}个月内本息一起还给资助人，过期不还，系统将对申请人和担保人封号处理！</td>
			</tr>
		</table>
	</form>

	</div>
</div>

<script>
	function submit_sq(e){
		if(!e){
			var pid = $("#pid").val();
			var pass2 = $("#pass2").val();
			$.get("{url:/ucenter/hk_save}",{pass2:pass2,pid:pid},function(data){
				if(data['status']=='success'){
					art.dialog.tips("<p class='"+data['status']+"'>"+data['msg']+"</p>",2);
            		setTimeout("tools_reload()",2000);
					window.location.href = "{url:/ucenter/application_support/rand/}"+Math.random()+"#tab-0";
				}else{
					alert(data['msg']);
				}
			},'json');
		}
		return false;
	}

</script>
